package com.example.express_auth2.dao;


import com.example.express_auth2.domain.User;
import com.example.express_auth2.domain.UserAuth;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.ArrayList;

@Mapper
public interface UserDao {
    /**
     * 查询用户信息
     * @param userPhone  用户手机号
     * @return
     */
    @Select("select * from user where user_phone=#{userPhone}")
    User getUserBYUserPhone(String userPhone);

    /**
     * 查询用户权限信息
     * @param userPhone 用户手机号
     * @return
     */
    @Select("SELECT * FROM user_auth WHERE user_phone=#{userPhone}")
    ArrayList<UserAuth> findRolesByUserPhone(String userPhone);
}
